﻿using System.Collections.Generic;
using System.Linq;
using System.Web.Mvc;
using Common.Objects.Enums;

namespace Common.Objects.Column
{
    public class ImageLinkListColumn : BaseColumn
    {
        public IList<ImageLinkColumn> Columns { get; set; }

        public ImageLinkListColumn(IEnumerable<ImageLinkColumn> columns)
        {
            Columns = columns.ToList();
        }

        public override string Render()
        {
            TagBuilder column = new TagBuilder("td");
            foreach (var item in Columns)
            {
                item.ColumnType = ColumnType.ImageLinkList;
                column.InnerHtml += item.Render();
            }

            return column.ToString(TagRenderMode.Normal);
        }
    }
}